﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using WROA.Models.IServices;
using DevExpress.Xpo;
using DevExpress.Xpo.DB;
using DevExpress.Data.Filtering;

namespace WROA.Models.Services
{
    public class Services : IService
    {
        public void Save(XPObject entity)
        {
            entity.Save();
        }

        public void Delete(XPObject entity)
        {
            entity.Delete();
            Session.DefaultSession.PurgeDeletedObjects();//物理删除所有被标记软删除的记录
        }

        //public void PhyDelete(XPObject entity)
        //{
        //    Session.DefaultSession.PurgeDeletedObjects();
        //}
        
        //public XPCollection FindAll()
        //{
        //    XPCollection xp = new XPCollection(typeof(T));
        //    return xp;
        //}

        ////public T FindKey(string key,string value)
        ////{
        ////    XPCollection xp = new XPCollection(typeof(T), new BinaryOperator(key, value, BinaryOperatorType.Equal));
        ////    return xp;
        ////}

    }
}